﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
using System.Windows.Data;

namespace BDSim
{
    /// <summary>
    /// 从bool类型转换到Right或Error的图片
    /// </summary>
    public class BoolToImageConverter:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            bool IsRight = (bool)value;
            string ImagePath = "";
            switch (IsRight)
            {
                case true:
                    ImagePath = @"/BDSim;component/Resources/Images/Right.png";
                    break;
                case false:
                    ImagePath = @"/BDSim;component/Resources/Images/Error.png";
                    break;
                default:
                    break;
            }
            return ImagePath;
        }
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
